package UIFree.controls.combobox
{
	import UIFree.uif_combobox;
	import UIFree.uif_component;
	
	import flash.geom.Rectangle;

	public class uif_comboNamed extends uif_combobox {
		private var _names: Array;
		public function uif_comboNamed(parent:uif_component, ax:int=0, ay:int=0, awidth:int=0, aheight:int=0, styleClass:String='') {
			super(parent, ax, ay, awidth, aheight, styleClass);
		}
		
		public function get names(): Array {
			return _names; 
		}

		public function set names(a_names: Array): void {
			var bi: Rectangle = listControl.getInner();
			_names = a_names;
			listControl.attachList(a_names, function(_area: uif_component, name: String, index: int): uif_component {
				return new uif_cbitem(_area, name, bi.x, bi.y + index * 20, bi.width, 20, style['item-class']);
			}); 
		}
	}
}